<%@ page language="java" contentType="text/html; charset=UTF-8"
		 pageEncoding="UTF-8" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path;
%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>


<html >
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<%--<meta name=”viewport” content=”width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0″ user-scalable=no />--%>
	<title>个人信息</title>
	<link rel="stylesheet" type="text/css" href="<%=path%>/css/aem-h5/aem-h5.css"/>
	<link rel="stylesheet" type="text/css" href="<%=path%>/css/aem-h5/LArea.css"/>
	<link rel="stylesheet" type="text/css" href="<%=path%>/css/aem-h5/LCalendar.css"/>
	<link rel="stylesheet" type="text/css" href="<%=path%>/css/aem-h5/sexSelect.css"/>
	<link rel="stylesheet" href="<%=path%>/css/aem-h5/style.css" >
	<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
	<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
	<link href="https://cdnjs.cloudflare.com/ajax/libs/framework7/1.6.5/css/framework7.ios.min.css" rel="stylesheet">
	<link href="https://cdnjs.cloudflare.com/ajax/libs/framework7/1.6.5/css/framework7.ios.colors.min.css" rel="stylesheet">


	<style>
		body {
			overflow: scroll;
			padding-bottom: 1rem;
		}

		.message-bg .input-bg .message, .message-bg .input-bg .phone {
			width: auto;
		}
		.message-bg .input-bg {
			width: 2.8rem;
		}
		.message-bg .input-bg, .message-bg .name {
			width: 2.8rem;
			padding-left: 0.45rem;
		}
		.message-bg li {
			height: 0.8rem;
			line-height: 0.8rem;
		}
		.message:first-child {
			margin-top: 0px !important;
		}
		.input-bg.sex {
			display: flex;
		}
		.input-bg.sex .text {
			line-height: 0.4rem;
		}
		.input-bg.sex .text.male {
			margin-right: 0.8rem;
		}

	</style>
</head>

<body>
<div id="app">
	<div>
		<ul class="message-bg">
			<input id="value1" type="hidden" value="">
			<input id="cid" type="hidden">
			<input id="staffId" type="hidden">
			<input id="provinceId" type="hidden">
			<input id="cityId" type="hidden">
			<input id="areaId" type="hidden">
			<input id="s" type="hidden">
			<input id="deptCode" type="hidden">
			<input id="deptId" type="hidden">
			<input type="hidden" value="<%=path%>" id="pathId">
			<input type="hidden" id="accessToken">
			<input type="hidden" id="oldOrgName">
			<input type="hidden" id="oldOrgId">
		</ul>
		<div class="submit">
			提交
		</div>
	</div>
</div>
</body>

</html>


<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/artDialog/7.0.0/dialog-plus.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/framework7/1.6.5/js/framework7.min.js"></script>
<script type="text/javascript" src="<%=path%>/js/aem/client/regionsObject2.js"></script>
<script type="text/javascript" src="<%=path%>/js/aem/client/cityPicker.js"></script>
<script type="text/javascript" src="<%=path%>/js/aem/client/rem.js"></script>
<script type="text/javascript" src="<%=path%>/js/aem/client/LCalendar.js"></script>
<script type="text/javascript" src="<%=path%>/js/aem/client/sexSelect.js"></script>
<script type="text/javascript" src="<%=path%>/js/marketing/validation.js"></script>
<script type="text/javascript" src="<%=path%>/js/dateUtils.js"></script>



<script type="text/javascript">
    var path = "<%=path%>";
    var cid = null;
    //var accessToken="07fb7a656dc11d5d942dbd597b8027f8";
    //var accessToken=$.cookie('accessToken');
    //初始化
    $(function () {

        cid = getQueryString('cid');
		/*cid = 1;*/
        loadStaffProData();
    });

    function loadStaffProData(){

        var url = path+"/aem/staffPropertyInfo/queryStaffPropertySetting";
        var data = {
            cid:cid,
            flag:1,
        };
        var e = JSON.parse(syncAjax("post", url , data , false));
        if(e.status == "200") {

            var arr = e.data;

            var html_ = '';
            for (var i = 0; i < arr.length; i++) {
                /* if(arr[i].keyName!='departmentId'){*/
                if (arr[i].keyName == 'name') {
                    if (arr[i].edit == "0") {
                        html_ += '<li>' + arr[i].labelName + '<input placeholder="' + arr[i].labelContent + '"  class="' + arr[i].keyName + '" id="' + arr[i].keyName + '" data-required="' + arr[i].required + '" readonly></li>'
                    } else {
                        html_ += '<li>' + arr[i].labelName + '<input placeholder="' + arr[i].labelContent + '"  class="' + arr[i].keyName + '" id="' + arr[i].keyName + '" data-required="' + arr[i].required + '" ></li>'
                    }
                } else if (arr[i].keyName == 'phone') {
                    if (arr[i].edit == "0") {
                        html_ += '<li>' + arr[i].labelName + '<div class="input-bg"><input readonly  class="' + arr[i].keyName + '" id="' + arr[i].keyName + '" data-required="' + arr[i].required + '" ><a><img src="' + path + '/images/aem/staffPropertyInfo.png" class="more"></a></div></li>'
                    } else {
                        html_ += '<li>' + arr[i].labelName + '<div class="input-bg"><input readonly  class="' + arr[i].keyName + '" id="' + arr[i].keyName + '" data-required="' + arr[i].required + '" ><a><img src="' + path + '/images/aem/staffPropertyInfo.png" class="more"></a></div></li>'
                    }
                } else if (arr[i].keyName == 'detailAddress') {
                    if (arr[i].edit == "0") {
                        html_ += '<li>' + arr[i].labelName + '<input placeholder="' + arr[i].labelContent + '" readonly  class="name" id="address" data-required="' + arr[i].required + '" data-edit="' + arr[i].edit + '"></li><li><input readonly placeholder="" style="margin-left: 0px" class="message address" id="' + arr[i].keyName + '" data-required="' + arr[i].required + '"></li>'
                    } else {
                        html_ += '<li>' + arr[i].labelName + '<input placeholder="' + arr[i].labelContent + '" readonly  class="name" id="address" data-required="' + arr[i].required + '" data-edit="' + arr[i].edit + '" ></li><li><input placeholder="" style="margin-left: 0px" class="message address" id="' + arr[i].keyName + '" data-required="' + arr[i].required + '"></li>'
                    }
                } else if (arr[i].keyName == 'birthday') {
                    html_ += '<li>' + arr[i].labelName + '<input placeholder="' + arr[i].labelContent + '" readonly  class="name" id="birthday" data-required="' + arr[i].required + '" data-edit="' + arr[i].edit + '"></li>';
                } else if (arr[i].keyName == 'departmentId') {
                    if (arr[i].edit == "0") {
                        html_ += '<li>' + arr[i].labelName + '<div class="input-bg"><input placeholder="请输入部门邀请码" style="margin-left: 0px" class="message" id="' + arr[i].keyName + '" readonly data-required="' + arr[i].required + '" ><a><img src="' + path + '/images/aem/staffPropertyInfo.png" class="more"></a></div></li>'
                    } else {
                        html_ += '<li>' + arr[i].labelName + '<div class="input-bg"><input placeholder="请输入部门邀请码" style="margin-left: 0px" class="message" id="' + arr[i].keyName + '" oninput="autoinput()" data-required="' + arr[i].required + '" ><a><img src="' + path + '/images/aem/staffPropertyInfo.png" class="more"></a></div></li>'
                    }
                } else if (arr[i].keyName == 'sex') {
                    /*html_ += '<li>' + arr[i].labelName + '<div class="input-bg"><input readonly placeholder="'+arr[i].labelContent+'" style="margin-left: 0px" class="message" id="'+arr[i].keyName+'" data-required="'+arr[i].required+'" data-edit="'+arr[i].edit+'"></div></li>'*/
                    if (arr[i].edit == "0") {
                        html_ += '<li>' + arr[i].labelName + '<div class="input-bg sex"><input type="radio" id="male" name="sex" value="m" disabled style="margin-left: 0px;" class="message" data-required="' + arr[i].required + '"><span class="text male">男</span><input type="radio" id="female" name="sex" value="f" disabled style="margin-left: 0px;" class="message" data-required="' + arr[i].required + '"><span class="text">女</span></div></li>'
                    } else {
                        html_ += '<li>' + arr[i].labelName + '<div class="input-bg sex"><input type="radio" id="male" name="sex" value="m"  style="margin-left: 0px;" class="message" data-required="' + arr[i].required + '"><span class="text male">男</span><input type="radio" id="female" name="sex" value="f"  style="margin-left: 0px;" class="message" data-required="' + arr[i].required + '"><span class="text">女</span></div></li>'
                    }
                } else {
                    if (arr[i].edit == "0") {
                        html_ += '<li>' + arr[i].labelName + '<div class="input-bg"><input readonly placeholder="' + arr[i].labelContent + '" style="margin-left: 0px; width:2.3rem;" class="message" id="' + arr[i].keyName + '" data-required="' + arr[i].required + '" ><a><img src="' + path + '/images/aem/staffPropertyInfo.png" class="more"></a></div></li>'
                    } else {
                        html_ += '<li>' + arr[i].labelName + '<div class="input-bg"><input placeholder="' + arr[i].labelContent + '" style="margin-left: 0px; width:2.3rem;" class="message" id="' + arr[i].keyName + '" data-required="' + arr[i].required + '" ><a><img src="' + path + '/images/aem/staffPropertyInfo.png" class="more"></a></div></li>'
                    }
                }
                /*  }*/
            }
            $(".message-bg").append(html_);
        }
    }

    //获取url的参数
    function getQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if (r != null)
            return unescape(r[2]);
        return null;
    }

    //ajax提交
    function syncAjax(type_, url_, data_  , async_) {
        var msg_ = null;
        $.ajax({
            dataType : "text",
            type : type_,
            url : url_,
            data : data_,
            async : async_,
            success : function(msg) {
                msg_ = msg;
            },
            error : function(msg) {
                msg_ = msg;
            }
        });
        return msg_;
    }
</script>

